#!/usr/bin/env python
# -*- coding:utf-8 -*-

# file:homework4_6.py
# author:wmf
# datetime:2021/4/12 15:19
# software: PyCharm
'''
this is function description
'''
# import module your need

import os, time


def showDir(Path):
    info1 = "           名称                 日期                   类型（文件夹或者 文件）       大小"
    print(info1)
    for x in os.listdir(Path):
        name = x
        timeStamp = os.path.getmtime(x)
        timeArray = time.localtime(timeStamp)
        Time = time.strftime('%Y-%m-%d %H:%M:%S', timeArray)
        # print('%14s' % x)
        # print('%14s' % Time)
        if os.path.isfile(x):
            if_file = '文件'
            file_size = str(os.path.getsize(x)) + "KB"
            # print('文件')
            # print(str(os.path.getsize(x)) + "KB")
        else:
            if_file = '文件夹'
            file_size = ''
            # print('文件夹')
        info2 = '''
%15s       %10s               %s                    %s
            '''%(name,Time,if_file,file_size)
        print(info2,end='')


showDir(os.getcwd())
